<!DOCTYPE html>
<html lang="zh">

	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title>Document</title>
	</head>

	<body>
		<div id="colee" style="overflow:hidden;height:80px;">
			<div id="colee1">
				<li>
					<a href="/">文字或图片实现向上无缝滚动</a>
				</li>

				<li>
					<a href="/">文字或图片实现向上无缝滚动</a>
				</li>

				<li>
					<a href="/">文字或图片实现向上无缝滚动</a>
				</li>

				<li>
					<a href="/">文字或图片实现向上无缝滚动</a>
				</li>

				<li>
					<a href="/">文字或图片实现向上无缝滚动</a>
				</li>

				<li>
					<a href="/">文字或图片实现向上无缝滚动</a>
				</li>
			</div>
			<div id="colee2"></div>
		</div>

		<script type="text/javascript">
			var speedi = 80;

			var colee2 = document.getElementById("colee2");

			var colee1 = document.getElementById("colee1");

			var colee = document.getElementById("colee");

			colee2.innerHTML = colee1.innerHTML; //克隆colee1为colee2

			function Marquee1() {

				//当滚动至colee1与colee2交界时

				if(colee2.offsetTop - colee.scrollTop <= 0) {

					colee.scrollTop -= colee1.offsetHeight; //colee跳到最顶端

				} else {
					colee.scrollTop++
				}
			}

			var MyMar1 = setInterval(Marquee1, speedi) //设置定时器
		</script>
	</body>

</html>